package com.jlg.managers;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.jlg.beans.groupon.GrouponApiBean;
import com.julewa.db.DB;
import com.julewa.db.Identifier;
/**
*
* author: huazhang
* since : 2011-3-15
*/
@Component
@SuppressWarnings("unchecked")
public class GrouponApiManager
{
    private @Autowired
    DB db;
    private @Autowired
    Identifier idsrv;

    public boolean save(GrouponApiBean om)
    {
        long id = idsrv.generate("grouponapi");
        om.setId(id);
        return db.insert("grouponapi.insert", om);
    }

    public List<GrouponApiBean> getAll()
    {
        return db.getList("grouponapi.all", null);
    }

   

}
